package com.erp.myAdapter

import android.annotation.SuppressLint
import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.BaseAdapter
import com.erp.bean.ZhiLiangBean
import com.erp.R
import com.erp.util.Myutil
import kotlinx.android.synthetic.main.lv_buzhou.view.*

/**
 * Created by Administrator on 2018/8/1/001.
 * 作者：刘洋
 */
class BuzhouKAdapter(var context: Context, var buzhoulist: MutableList<ZhiLiangBean.buzhou>) : BaseAdapter() {
    var minflater: LayoutInflater = LayoutInflater.from(context)
    @SuppressLint("ViewHolder")
    override fun getView(position: Int, convertView: View?, parent: ViewGroup?): View {
        var v=minflater.inflate(R.layout.lv_buzhou,null)
        val buzhou =buzhoulist[position]
        Myutil.settv(buzhou.gangwei_name, v.tvGangwei)
        Myutil.settv(Myutil.getdata(buzhou.ctime),v.tvGangweiTime)
        return v
    }

    override fun getItem(position: Int): Any = buzhoulist[position]

    override fun getItemId(position: Int): Long = position.toLong()

    override fun getCount(): Int = buzhoulist.size

}